<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>卖家-修改个人信息</title>
<link href="<?php echo $this->_webroot('/user/css/common.css'); ?>" rel="stylesheet" type="text/css" />
<link href="<?php echo $this->_webroot('/user/css/content1.css'); ?>" rel="stylesheet" type="text/css" />
<script src="<?php echo $this->_webroot('/user/js/jquery-1.7.1.min.js'); ?>" type="text/javascript"></script>
<script src="<?php echo $this->_webroot('/user/js/common.js'); ?>" type="text/javascript"></script>


 
</head>
<body>
<psp:tags     htmlname='user_topnav1'  iconname='usertopnav1' />
<psp:tags     htmlname='user_topsearch'  iconname='usertopsearch' />

<div class="main">
	<div class="main-left">
    	<div class="title">会员管理中心</div>
        <psp:tags     htmlname='user_menulist'  iconname='usermenulist' />
    </div>
<link href="<?php echo $this->_webroot('/user/css/shoprequest.css'); ?>" rel="stylesheet" type="text/css" />   
    <div class="main-right main_right">
	

            <div class="cont">
                <div class="title_uc"><h3>我的订单</h3></div>               

             <div id="stepTip" class="clearfix">
			     <ul class="list_step1 clearfix">
			     <li>第一步:<br />设置收货人地址</li>
			     <li class="now">第二步:<br />确认订单</li>
			     <li style="padding-right:0">第三步:<br />完成</li>
			     </ul>
             </div>	  
			<form action="<?php echo $this->_url('user/userdoorder/');?>" method="post" name="for个人信息" onsubmit="return checkform();">
				
        <?php if (isset($customer_cat['shopcustomcat']['custom_cat_name'])) { ?>
				<table width="100%" border="0" cellspacing="0">
					<input type="hidden" value="<?php echo  $goods_info[0]['shop_id'];?>" name="sshop_id" />
					<tr><th colspan="2">商品名称</th><th>商品价格</th><th>VIP价格</th><th>购买数量</th></tr>
					<?php foreach($goods_info as $k=>$v){?>
					<tr><td class="name" colspan="2"><a href="<?php echo $this->_url('shop/productshow/'.$v['id']);?>" target="_blank"><?php echo  $v['goods_name'];?></a></td>
					<td align="center"><?php echo  $v['goods_price'];?>元</td>
					<td align="center"><?php echo  (($v['goods_price'] * $customer_cat['shopcustomcat']['rebate'])/10);?>元</td>					
					<td align="center" ><?php echo  $buy_goods[$v['id']];?></td>
					<input type="hidden" value="<?php echo  $v['id'];?>" name="goods_id[]" />
					<input type="hidden" value="<?php echo  $v['goods_name'];?>" name="goods_name[]" />
					<input type="hidden" value="<?php echo  (($v['goods_price'] * $customer_cat['shopcustomcat']['rebate'])/10);?>" name="goods_price[]" />
					<input type="hidden" value="<?php echo  $v['goods_price'];?>" name="goods_old_price[]" />					
					<input type="hidden" value="<?php echo  $buy_goods[$v['id']];?>" name="order_num[]" />
					<input type="hidden" value="<?php echo  (($v['goods_price'] * $customer_cat['shopcustomcat']['rebate'])/10) *$buy_goods[$v['id']] ;?>" id="order_amount" name="order_amount[]" />
					</tr>
					<?php }?>
				</table>		
		<table width="100%" class="form_table">
			<tr class="center"><th colspan="2">店铺VIP等级</th></tr>
            <tr>
			    <td >等级名称:<?php echo $customer_cat['shopcustomcat']['custom_cat_name'];?>,对应折扣:<?php echo $customer_cat['shopcustomcat']['rebate'];?>折</td>
			</tr>
					<input type="hidden" name="rebatemoney" value="<?php echo $customer_cat['shopcustomcat']['rebate'];?>" />				
		</table>		
		<?php }else { ?>	
				<table width="100%" border="0" cellspacing="0">
					<input type="hidden" value="<?php echo  $goods_info[0]['shop_id'];?>" name="sshop_id" />
					<tr><th colspan="2">商品名称</th><th>商品价格</th><th>购买数量</th></tr>
					<?php foreach($goods_info as $k=>$v){?>
					<tr><td class="name" colspan="2"><a href="<?php echo $this->_url('shop/productshow/'.$v['id']);?>" target="_blank"><?php echo  $v['goods_name'];?></a></td>
					<td align="center"><?php echo  $v['goods_price'];?>元</td>
					<td align="center" ><?php echo  $buy_goods[$v['id']];?></td>
					<input type="hidden" value="<?php echo  $v['id'];?>" name="goods_id[]" />
					<input type="hidden" value="<?php echo  $v['goods_name'];?>" name="goods_name[]" />
					<input type="hidden" value="<?php echo  $v['goods_price'];?>" name="goods_price[]" />
					<input type="hidden" value="<?php echo  $v['goods_price'];?>" name="goods_old_price[]" />					
					<input type="hidden" value="<?php echo  $buy_goods[$v['id']];?>" name="order_num[]" />
					<input type="hidden" value="<?php echo  $v['goods_price'] *$buy_goods[$v['id']] ;?>" id="order_amount" name="order_amount[]" />
					</tr>
					<?php }?>
				</table>
									<input type="hidden" name="rebatemoney" value="10" />
        <?php } ?>		
				
		<table width="100%" class="form_table">
			<tr class="center"><th colspan="7">选择的支付方式</th></tr>
					<tr><td class="center" colspan="7">
						<?php echo  $payment[$payment_info['shoppayment']['pay_id']];?></td>
					<tr>			
		</table>
		
				<table id="transport_type" width="100%" border="0" cellspacing="0">
					<tr>
						<tr class="center"><th colspan="7" align="left">运费</th></tr>
					</tr>
					<tr>
						<td colspan="7">
							<div id="transport_box">
								<?php echo  $user_info['logistics_money'];?>元
							</div>
						</td>
					</tr>					
					<tr>
						<td colspan="7">
							<div id="transport_box">
								运输方式:<?php echo  $user_info['logistics_content'];?>
							</div>
						</td>
					</tr>					
				</table>				
<!--
				<table id="transport_type" width="100%" border="0" cellspacing="0">
					<tr>
						<tr class="center"><th colspan="7" align="left">运费</th></tr>
					</tr>
					<tr>
						<td colspan="7">
							<div id="transport_box">
								<?php echo $transport_type_str;?>
							</div>
						</td>
					</tr>
				</table>
-->				
				
				<table id="oldAddress" width="100%" border="0" cellspacing="0">
					<tr>
						<th align="left" width="200">&nbsp;&nbsp;收货信息</th><th align="right"><span onclick="clearaddress();"></span></th>
					</tr>
					<tr><td class="textright">联系人：</td>
						<td align="left"><?php echo  $user_info['to_user_name'];?></td></tr>
					<tr>
						<td class="textright">所在地区：</td>
						<td>
							  <?php echo $areas_info[0][$user_info['user_country']]['area_name'];?>
                              <?php echo $areas_info[1][$user_info['user_province']]['area_name'];?>
                              <?php echo $areas_info[2][$user_info['user_city']]['area_name'];?>
                              <?php echo $areas_info[3][$user_info['user_district']]['area_name'];?>
						</td>
					</tr>
					<tr><td class="textright">详细地址：</td>
					<td><?php echo  $user_info['full_address'];?></td></tr>
					<tr><td class="textright">邮政编码：</td>
					<td><?php echo  $user_info['zipcode'];?></td></tr>
					<tr><td class="textright">手机：</td>
						<td><?php echo  $user_info['mobile'];?></td></tr>
					<tr><td class="textright">电话：</td>
						<td><?php echo  $user_info['telphone'];?></td></tr>
					<tr><td class="textright">邮箱：</td>
						<td><?php echo $user_info['email'];?></td></tr>
					<tr><td></td><td><span>请确认以上的收货信息，以确保能够收到商品！</span></td></tr>
				</table>
				

				<table width="100%" border="0" cellspacing="0">
					<tr>
						<th width="200" align="left">&nbsp;&nbsp;确认提交订单</th><th></th>
					</tr>
					<tr><td class="textright" valign="top">订单附言：</td><td><textarea name="message" style="width:280px;height:60px" id="textareac" onkeyup="this.value=this.value.slice(0,300);"></textarea></td></tr>
					<tr><td colspan="2" align="center">
					<input type="hidden" name="to_user_name" value="<?php echo  $user_info['to_user_name'];?>" />
					<input type="hidden" name="full_address" value="<?php echo  $user_info['full_address'];?>" />
					<input type="hidden" name="zipcode" value="<?php echo  $user_info['zipcode'];?>" />
					<input type="hidden" name="mobile" value="<?php echo  $user_info['mobile'];?>" />
					<input type="hidden" name="telphone" value="<?php echo  $user_info['telphone'];?>" />
					<input type="hidden" name="email" value="<?php echo  $user_info['email'];?>" />
					<input type="hidden" name="country" value="<?php echo $user_info['user_country'];?>" />
					<input type="hidden" name="province" value="<?php echo $user_info['user_province'];?>" />
					<input type="hidden" name="city" value="<?php echo $user_info['user_city'];?>" />
					<input type="hidden" name="district" value="<?php echo $user_info['user_district'];?>" />
					<input type="hidden" name="transportcontent" value="<?php echo  $user_info['logistics_content'];?>" />					
					<input type="hidden" name="transportmoney" value="<?php echo  $user_info['logistics_money'];?>" />					
					<input type="hidden" name="pay_id" value="<?php echo  $payment_info['shoppayment']['id'];?>" />
					<input type="hidden" name="pay_name" value="<?php echo  $payment[$payment_info['shoppayment']['pay_id']];?>" />
					<input type="hidden" name="real_transport_money" id="real_transport_money" value="0" />
					<input type="button" onclick="javacript:history.go(-1);" name="submit" class="submit" value="更换地址" />
					<input type="submit" name="submit" class="submit" onclick="do_transports()" value="提交订单" /></td></tr>
				</table>

			</form>
			  
			  
            </div>
	
	

        

    </div>
    <div class="clear"></div>
</div>

<div class="footer">
    <psp:tags     htmlname='user_footer_helper'  iconname='userfooterhelper' />

</div>
<script language="JavaScript" src="<?php echo $this->_webroot('servtools/ajax_client/ajax.js');?>"></script>
<script language="JavaScript">
<!--

function areachanged(value,type){
	if(value > 0) {
		ajax("<?php echo $this->_url('user/getareas');?>","POST","value="+value+"&mode=useraddress&pre=user_&type="+type,function(return_text){
			var return_text = return_text.replace(/[\n\r]/g,"");
			if(return_text==""){
//				alert("");
			} else {
				if(type==0) {
					document.getElementById("user_province").innerHTML = return_text;
					show("user_province");
					hide("user_city");
					hide("user_district");
				} else if(type==1) {
					document.getElementById("user_city").innerHTML = return_text;
					show("user_city");
					hide("user_district");
				} else if(type==2) {
					document.getElementById("user_district").innerHTML = return_text;
					show("user_district");
				}
			}
			var obj = document.getElementsByName('transporttype');
			for(i=0;i<obj.length;i++){
				if(obj[i].checked){
					var transporttype_value=obj[i].value;
				}
			}
//			getallpay(transporttype_value);
		});
	} else {
		if(type==2) {
			hide("user_district");
		} else if(type==1) {
			hide("user_district");
			hide("user_city");
		} else if(type==0) {
			hide("user_district");
			hide("user_city");
			hide("user_province");
		}
	}
}
function hide(id) {
	document.getElementById(id).style.display = 'none';
}

function show(id) {
	document.getElementById(id).style.display = '';
}

function checkform(){
	var to_user_name = document.getElementsByName('to_user_name')[0];
	if(to_user_name.value==''){
		alert('请填写收件人姓名');
		return false;
	}

	var province = document.getElementsByName('province')[0];
	if(province.value==0){
		alert('请选择收件人省份');
		return false;
	}

	var city = document.getElementsByName('city')[0];
	if(city.value==0){
		alert('请选择收件人城市');
		return false;
	}

	var district = document.getElementsByName('district')[0];
	if(district.value==0){
		alert('请选择收件人地区');
		return false;
	}

	var full_address = document.getElementsByName('full_address')[0];
	if(full_address.value==''){
		alert('请填写收件人详细地址');
		return false;
	}

	var zipcode = document.getElementsByName('zipcode')[0];
	if(zipcode.value==''){
		alert('请填写邮政编码');
		return false;
	}

	var email = document.getElementsByName('email')[0];
	var user_email_reg = /^[0-9a-zA-Z_\-\.]+@[0-9a-zA-Z_\-]+(\.[0-9a-zA-Z_\-]+)*$/;
	if(!email.value=='' && !user_email_reg.test(email.value)){
		alert('您填写的邮箱格式不正确');
		return false;
	}

	var textareac = document.getElementById("textareac");
	if(textareac.value.length>300){
		alert("输入字数超长");
		textareac.focus();
		return false;
	}
	return true;

	var user_mobile = document.getElementsByName('mobile')[0];
	var user_mobile_reg = new RegExp("[0-9-]{5,15}");

	var user_telphone = document.getElementsByName('telphone')[0];
	var user_telphone_reg = new RegExp("[0-9-]{5,15}");

	if(user_mobile.value=='' && user_telphone.value=='') {
		alert('对不起，电话和手机至少填写一项。');
		return false;
	} else if(!user_mobile.value=='' && !user_mobile_reg.test(user_mobile.value)) {
		alert('对不起，您输入的手机号码错误。');
		return false;
	} else if(!user_telphone.value=='' && !user_telphone_reg.test(user_telphone.value)) {
		alert('对不起，您输入的电话号码错误。');
		return false;
	}else {
		return true;
	}


}
function do_transports(){
	var transports = document.getElementsByName('transport_type')[0];
	for(i=0;i<transports.length;i++){
		if(transports[i].selected){
			var val=transports[i].value;
		}
	}
	change_transport(val);
	return true;
}
function changeurl(v){
	var re = /&address_id=[0-9]+/g;
	location.href = location.href.replace(re,'')+'&address_id='+v;
}

function clearaddress() {
//	areachanged(1,0);
	var to_user_name = document.getElementsByName('to_user_name')[0];
	to_user_name.value="";
	var full_address = document.getElementsByName('full_address')[0];
	full_address.value="";
	var zipcode = document.getElementsByName('zipcode')[0];
	zipcode.value="";
	var mobile = document.getElementsByName('mobile')[0];
	mobile.value="";
	var telphone = document.getElementsByName('telphone')[0];
	telphone.value="";
	var email = document.getElementsByName('email')[0];
	email.value="";
	var user_country = document.getElementsByName('country')[0];
	for(i=0;i<user_country.length;i++){
		if(user_country[i].value==0){
			user_country[i].selected=true;
		}
	}
	hide("user_province");
	hide("user_city");
	hide("user_district");
}
function change_transport(val){
	document.getElementById('real_transport_money').value=val;
}
//-->
</script>
</body>
</html>